package org.freedom.imarket.controller;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.freedom.imarket.dao.UserDAO;
import org.freedom.imarket.entities.User;
import org.freedom.util.CloneHibernate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {

	@Autowired
	UserDAO userDao;

	@RequestMapping(value = "/**/user/list.do", method = RequestMethod.GET)
	@ResponseBody
	public
	List<User> getUserList() throws Exception {
		List<User> _users = userDao.loadAll();
		List<User> users = CloneHibernate.cloneHibernateList(_users);
		return users;
	}

}
